﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Datacollection
{
    public partial class Userlogin : Form
    {
        public Userlogin()
        {
            InitializeComponent();
        }

        private void cancel_btn_Click(object sender, EventArgs e)
        {
            this.Close();
        }


        //登录
        private void ok_btn_Click(object sender, EventArgs e)
        {
            if(account_txb.Text=="admin" && password_txb.Text == "123456")
            {
                MessageBox.Show("登录成功！");
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("登录失败，请重新输入账号密码！");
            }
        }

        //（为了将Textbox改为多行模式来改变大小）屏蔽Enter键
        private void password_txb_KeyDown(object sender, KeyEventArgs e)
        {
            if((int)e.KeyCode == 13){ 
                e.SuppressKeyPress = true;
            }
        }
    }
}
